package org.bambrikii.site.base.business.managers;

import org.bambrikii.site.base.business.managers.core.ManagerException;
import org.bambrikii.site.base.business.managers.crud.CrudManager;
import org.bambrikii.site.base.core.dao.IDAOBase;

public class ManagerBase<T, DAOBaseT extends IDAOBase<T>> implements
		CrudManager<T> {
	protected DAOBaseT dao;

	public ManagerBase(DAOBaseT dao) throws ManagerException {
		this.dao = dao;
	}

	public void saveOrUpdate(T obj) throws ManagerException {
		dao.saveOrUpdate(obj);
	}

	public void delete(T obj) throws ManagerException {
		dao.delete(obj);
	}

	public T getById(Integer id) throws ManagerException {
		return (T) dao.getById(id);
	}
}
